<?
	$functions_uri = str_replace(str_replace($_SERVER['DOCUMENT_ROOT'],"",dirname(__FILE__)),"/drizzo/engine/functions.php",dirname(__FILE__));
	require_once($functions_uri);

	$user_id = session_user_id;
	$ajax = $_GET['ajax'];
	$post_id = $_GET['post_id'];

	if($ajax) {
?>
<form id="comment_form" action="" method="post" name="comment_form" onsubmit="document.getElementById('comments').innerHTML = '<p class=\'loading\'>Saving your comment...</p>';new Ajax.Updater('comments','<? echo drizzo_theme('directory'); ?>comments.php?post_id=<? echo $post_id; ?>', {method: 'post', parameters: Form.serialize(this)});">
<?
	} else {
?>
<form id="comment_form" action="" method="post" name="comment_form">
<?
	}
?>
	<input type="hidden" name="author_id" value="<? echo $drizzo_user_option['ID']; ?>"></input>
	<input type="hidden" name="author_ip" value="<? echo $_SERVER['REMOTE_ADDR']; ?>"></input>
	<input type="hidden" name="post_id" value="<? echo $post_id; ?>"></input>
	<label for="author_name">Name:</label><input type="text" name="author_name" value="<? echo $drizzo_user_option['nice_name']; ?>"></input><br />
	<label for="author_email">Email:</label><input type="text" name="author_email" value="<? echo $drizzo_user_option['email']; ?>"></input><br />
	<label for="author_email">Website:</label><input type="text" name="author_url" value="<? echo $drizzo_user_option['url']; ?>"></input><br />
	<label for="title">Title:</label><input type="text" name="title"></input><br />
	<label for="content">Comment:</label><textarea name="content"></textarea><br />
<?
	if($ajax) {
?>
	<p class="center"><input type="button" name="cancel" class="submit" value="Cancel" onclick="new Effect.Fade('comment_box')"></input> <input type="submit" name="post_comment" class="submit" value="Submit Comment" onlick="document.comment_form.post_comment.value = 'Submitting...'"></input></p>
<? 
	} else {
?>
	<p class="center"><input type="reset" name="cancel" class="submit" value="Reset" /> <input type="submit" name="post_comment" class="submit" value="Submit Comment" onlick="document.comment_form.post_comment.value = 'Submitting...'"></input></p>
<?
	}
?>
</form>